using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Keep.Model;
using Keep.Util;
using Newtonsoft.Json.Linq;
using Serilog;

namespace Keep.Service.Impl;

public class UserServiceImpl : IUserService
{

    public async Task<List<User>> GetAllUser()
    {
        Log.Warning("IN");
        return await SqlSugarHelper.Db.Queryable<User>().ToListAsync();
    }

    public async Task<User> Login(string name, string pass)
    {
        Log.Warning("Login => name:" + name + "  pass:" + pass);
        return await SqlSugarHelper.Db.Queryable<User>().Where(u => u.Name.Equals(name) && u.PassWord.Equals(pass)).SingleAsync();
    }

    public async Task<Boolean> LogOut()
    {
        Log.Warning("IN");
        await Task.Yield();
        return true;
    }
}
